﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Pyramid.Extentions;

namespace Pyramid.Models
{
	public class Customer
	{
		public int Id { get; set; }

		[Display(Name = "顾客编码")]
		[MaxLength(20)]
		public string Code { get; set; }

		[Display(Name = "顾客姓名")]
		[MaxLength(20)]
		public string FullName { get; set; }

		[Display(Name = "英文名")]
		[MaxLength(20)]
		public string EnglishName { get; set; }

		[Display(Name = "出生日期")]
		public DateTime Birthday { get; set; }

		[Display(Name = "性别")]
		public int Gender { get; set; }

		[NotMapped]
		public Genders GenderEnum
		{
			get { return (Genders) Gender; }
		}

		[NotMapped]
		public string GenderString
		{
			get { return GenderEnum.ToDescription(); }
		}

		[Display(Name = "职业")]
		[MaxLength(20)]
		public string Profession { get; set; }

		[Display(Name = "教育程度")]
		[MaxLength(20)]
		public string Education { get; set; }

		[Display(Name = "联系地址")]
		[MaxLength(100)]
		public string Address { get; set; }

		[Display(Name = "邮编")]
		[MaxLength(20)]
		public string PostalCode { get; set; }

		[Display(Name = "传真")]
		[MaxLength(20)]
		public string Fax { get; set; }

		[Display(Name = "证件号码")]
		[MaxLength(20)]
		public string IdCard { get; set; }

		[Display(Name = "证件类型")]
		public int CardType { get; set; }

		[NotMapped]
		public CardTypes CardTypeEnum
		{
			get { return (CardTypes) CardType; }
		}

		[Display(Name = "联系电话")]
		[MaxLength(20)]
		public string Tel { get; set; }

		[Display(Name = "手机")]
		[MaxLength(20)]
		public string Mobile { get; set; }

		[Display(Name = "电子邮箱")]
		[MaxLength(20)]
		public string Email { get; set; }

		[Display(Name = "兴趣爱好")]
		[MaxLength(100)]
		public string Interest { get; set; }

		[Display(Name = "婚姻")]
		public int MaritalStatus { get; set; }

		[NotMapped]
		public MaritalStatus MaritalStatusEnum
		{
			get { return (MaritalStatus) MaritalStatus; }
		}

		[NotMapped]
		public string MaritalStatusString
		{
			get { return MaritalStatusEnum.ToDescription(); }
		}

		[Display(Name = "个人年收入")]
		public int RevenueLevel { get; set; }

		[NotMapped]
		public RevenueLevels RevenueLevelEnum
		{
			get { return (RevenueLevels) RevenueLevel; }
		}

		[NotMapped]
		public string RevenueLevelString
		{
			get { return RevenueLevelEnum.ToDescription(); }
		}

		[Display(Name = "接收公司资讯")]
		public bool ReceiveNews { get; set; }

		[Display(Name = "VIP顾客")]
		public bool IsVip { get; set; }

		[Display(Name = "备注")]
		[MaxLength(100)]
		public string Remark { get; set; }

		[Display(Name = "建档人")]
		[MaxLength(20)]
		public string CreateUserId { get; set; }

		[Display(Name = "建档日期")]
		public DateTime CreateTime { get; set; }

		[Display(Name = "最后修改时间")]
		public DateTime EditTime { get; set; }

		[Display(Name = "最后修改人")]
		[MaxLength(20)]
		public string EditUserId { get; set; }

		[Display(Name = "登录账号")]
		[MaxLength(20)]
		public string UserId { get; set; }

		[Display(Name = "隶属管理中心")]
		public int? AdminCenterId { get; set; }

		[Display(Name = "直属会员中心")]
		public int? MemberCenterId { get; set; }

		[ForeignKey("AdminCenterId")]
		public virtual AdminCenter AdminCenter { get; set; }

		[ForeignKey("MemberCenterId")]
		public virtual MemberCenter MemberCenter { get; set; }
	}
}